package ms.pc.inf;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class AttendingUsers extends ListActivity{
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		final ListView lv = getListView();
		TextView heading = new TextView(this);
		heading.setText("Users attending this event");
		TextView footer = new TextView(this);
		footer.setClickable(true);
		footer.setTextSize(30);
		footer.setHeight(30);
		footer.setText("Click to View Map Location");
		footer.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				mapView();
				
			}
		});
		
		lv.addFooterView(footer);
		lv.addHeaderView(heading);
		lv.setClickable(false);
		lv.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1 , DBConnectivity.listUsersByEvent));
		lv.setTextFilterEnabled(true);

	}

	private void mapView()
	{
		startActivity(new Intent(this, EventMapLocation.class));
		this.finish();
	}
}
